var uid, ws, title, tid, action, str;
document.addEventListener('plusready', function(){
	uid = plus.storage.getItem('uid');
	ws = plus.webview.currentWebview();
	title = ws.title;
	console.log(title);
	$('.mui-title').text(title);
	if(title == '收入记录'){
		tid = 77;
		action = '';
		str = '+';
		return;
	}else{
		tid = 78;
		action = 'cashRecord';
		str = '-';
	}
//	console.log(apiRoot+"/home/income/"+action+"/uid/"+uid+"/tid/"+tid);
	$.ajax({
		type:"get",
		url:apiRoot+"/home/income/"+action,
		data:{
			uid :uid,
			tid :tid
		},
		dataType :'json',
		success :function(data){
			if(data.length >0){
				var list = '';
				$.each(data, function(k, v) {
					list += '<div class="mui-table-view mui-table-view-cell">'+
						'<li>'+
							'<span class="color-red">'+str+v.money+'元</span>'+
							'<span class="mui-pull-right mui-h6">'+v.addtime+'</span>'+
						'</li>'+
						'<li class="mui-h6 color-000">'+v.platform+'</li>'+
					'</div>';
				});
				$('#content').html(list);
			}
			
		},
		error :function(e){
			console.log(JSON.stringify(e));
			errortoast();
		}
	});
}, false)